﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CafeOnline.MvcFramework.Composition {
    public class PartFactory<TPart, TMetadata> : PartFactory<TPart> {
        #region Constructor
        /// <summary>
        /// Initialises a new instance of <see cref="PartFactory{TPart,TMetadata}" />.
        /// </summary>
        /// <param name="delegate">The delegate used to create the part.</param>
        /// <param name="metadata">The metadata for the part.</param>
        public PartFactory(Func<PartLifetimeContext<TPart>> @delegate, TMetadata metadata)
            : base(@delegate) {
            Metadata = metadata;
        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets the metadata for the part.
        /// </summary>
        public TMetadata Metadata { get; private set; }
        #endregion
    }
}
